package com.heu.blood.common.commponent;

import com.heu.blood.dict.entity.DictDepartmentEntity;
import com.heu.blood.dict.service.DictDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.List;

@Component
public class DictDeaprtmentLoader {
    /**
     * 科室字典实体
     */
    private List<DictDepartmentEntity> dictDepartmentEntities;

    @Autowired
    private DictDepartmentService dictDepartmentService;


    @PostConstruct
    public void setDictDepartment(){ dictDepartmentEntities = dictDepartmentService.list();
    }

    // 提供访问字典数据的方法
    public List<DictDepartmentEntity> getDictDepartment(){
        return this.dictDepartmentEntities;
    }
}
